package cn.hwadee.muying.service;

import cn.hwadee.muying.entity.Job;
import cn.hwadee.muying.entity.WorkerLevel;
import cn.hwadee.muying.mapper.JobMapper;
import cn.hwadee.muying.commons.base.BaseService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.springframework.stereotype.Service;
import cn.hwadee.muying.entity.User;
import cn.hwadee.muying.commons.page.MyPage;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;

/**
 * <p>
 * 职位 服务实现类
 * </p>
 *
 * @author Mankind
 * @since 2018-08-03
 */
@Service
public class JobService extends BaseService<JobMapper, Job> {

    @Autowired
    private JobMapper jobMapper;


    public MyPage<Job> list(MyPage<Job> page, User cUser) throws Exception{
        List<Job> jobs = jobMapper.list(page,cUser);
        page.setRecords(jobs);
        return page;
    }

    public List<Job> selectAll() {
        return jobMapper.selectList(
                new EntityWrapper<Job>()
                        .and("valid=1")
        );
    }
}
